// PmacBase.h: interface for the CPmacBase class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PMACBASE_H__0A56C0A7_D9C7_4E52_AC4F_1A883B112A73__INCLUDED_)
#define AFX_PMACBASE_H__0A56C0A7_D9C7_4E52_AC4F_1A883B112A73__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "pmac.h"

class CPmacBase  
{
public:
	CPmacBase();
	virtual ~CPmacBase();
	CCriticalSectionBaseAPI m_OneControlCard;

	int LoadFNDll();
	CString m_lastError;
	int CheckHome(int iAxis);
	int CheckDone(int iAxis);
	int JogToHome(int iAxis);
	int JogToDistance(int iAxis, int iDistance);
	int JogToPos(int iAxis, int iPos);
	
	int ContiusMove(int iAxis,int iDirect);
	int StopJogMove(int iAxis);
	int StopProgramMove();
	int IsLimit(int iAxis);
	int GetAbsPos(int iAxis, double* dPos);
	int GetAbsSpeed(int iAxis, double* dPos);
	int EnableAxis(int iAxis);
	int DisableAxis(int iAxis);
	int EnableCoordinateSystem(int iMathIAxis, int iAxis);
	int SendData(CString strSendData, CString& strResponse);
	int DownLoadFile();
	int BeginMove();
	int SetMVarValue(int iPos, int iValue);
	int GetMVarValue(int iPos);

	int IsRunningProgram();
protected:
	HINSTANCE m_hPmacLib;
	OpenPmacDevice m_OpenPmacDevice;
	ClosePmacDevice m_ClosePmacDevice;
	PmacSelect m_PmacSelect;	
	LockPmac m_LockPmac;	
	ReleasePmac m_ReleasePmac;	
	PmacGetResponseExA m_PmacGetResponseExA;
	PmacDownloadA m_PmacDownloadA;
};

#endif // !defined(AFX_PMACBASE_H__0A56C0A7_D9C7_4E52_AC4F_1A883B112A73__INCLUDED_)
